package com.dslu.fx.service.impl;

import com.dslu.fx.dao.StockBillDao;
import com.dslu.fx.domain.StockBillDO;
import com.dslu.fx.service.StockBillService;
import com.dslu.fx.vo.ProdVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class StockBillServiceImpl implements StockBillService {
	@Autowired
	private StockBillDao stockBillDao;
	
	@Override
	public StockBillDO get(Integer id){
		return stockBillDao.get(id);
	}
	
	@Override
	public List<StockBillDO> list(Map<String, Object> map){
		return stockBillDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return stockBillDao.count(map);
	}
	
	@Override
	public int save(StockBillDO stockBill){
		return stockBillDao.save(stockBill);
	}
	
	@Override
	public int update(StockBillDO stockBill){
		return stockBillDao.update(stockBill);
	}
	
	@Override
	public int remove(Integer id){
		return stockBillDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return stockBillDao.batchRemove(ids);
	}

    @Override
    public PageInfo<StockBillDO> getStockBillList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<StockBillDO> list = stockBillDao.getStockBillList(map); // 获取数据
        PageInfo<StockBillDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public StockBillDO getOne(Map<String, Object> map){
        return stockBillDao.getOne(map);
    }

	@Override
	public List<ProdVO> getStockByAreaId(Integer areaId) {
		return stockBillDao.getStockByAreaId(areaId);
	}

}
